package com.sqxgg.drugstore.email;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSenderImpl;

@Configuration
public class JavaMailConfiger {


    @Bean
    public JavaMailSenderImpl JavaMailSender() {
        JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
        mailSender.setHost("smtp.163.com");
        mailSender.setUsername("MyDreamChangeWorld@163.com");
        mailSender.setPassword("VZLCBPZQWWJTNXVP");
        mailSender.setProtocol("smtp");
        mailSender.getJavaMailProperties().setProperty("mail.smtp.auth","true");
        mailSender.getJavaMailProperties().setProperty("mail.smtp.ssl.enable","true");
        mailSender.getJavaMailProperties().setProperty("mail.smtp.starttls.enable","true");
        mailSender.getJavaMailProperties().setProperty("mail.smtp.starttls.required","true");
        return mailSender;

    }
}
